home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / envoy / envoysupport.lha / EnvoySupport / src / accountslib.c next >
Encoding:
C/C++ Source or Header  |  1993-11-26  |  713 b   |  33 lines

  1. extern void __regargs __autoopenfail(char *);
  2.  
  3. #include <constructor.h>
  4. #include <proto/accounts.h>
  5.  
  6. extern struct Library *OpenLibrary( UBYTE *libName, unsigned long version );
  7. extern void CloseLibrary( struct Library *library );
  8.  
  9. struct Library *AccountsBase ;
  10. static void *libbase;
  11. extern long __netlibversion;
  12.  
  13. CBMLIB_CONSTRUCTOR(openaccounts)
  14. {
  15.     AccountsBase = libbase = (void *)OpenLibrary("accounts.library", __netlibversion);
  16.     if (AccountsBase == NULL)
  17.     {
  18.         __autoopenfail("accounts.library");
  19.         return 1;
  20.     }
  21.  
  22.     return 0;
  23. }
  24.  
  25. CBMLIB_DESTRUCTOR(closeaccounts)
  26. {
  27.     if (libbase)
  28.     {
  29.         CloseLibrary((struct Library *)libbase);
  30.         libbase = AccountsBase = NULL;
  31.     }
  32. }
  33.